<template>
  <div>
    <!-- 我的订单 -->
    <van-nav-bar
      title="我的订单"
      left-text="返回"
      left-arrow
      @click-left="
        () => {
          $router.push('/home/my');
        }
      "
    />
    <!-- 搜索+防抖 -->
    <!-- <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" /> -->
    <!-- 下拉 -->
    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
    <van-list
      v-model:loading="loading"
      :finished="finished"
      finished-text="没有更多了" 
    >
      <!-- <van-cell v-for="item in list" :key="item" :title="item" /> -->
       <!-- 订单 -->
    <van-card
      v-for="item in orderData"
      :price="item.goods_price"
      :title="item.goods_name"
      :thumb="item.goods_big_logo"
    />
    </van-list>
  </van-pull-refresh>
    
  </div>
  
</template>

<script setup>
import { ref } from "vue";
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
const refreshing = ref(false);
let orderData = ref([]);
import { orderApi } from "@/api/api";
orderApi().then((res) => {
  console.log("订单数据", res);
  orderData.value = res.data.message.goods;
});
// import _ from 'lodash'
// const onLoad = () => {

// };
const onRefresh = () => {
  // 清空列表数据
  finished.value = false;

  // 重新加载数据
  // 将 loading 设置为 true，表示处于加载状态
  loading.value = true;
  // onLoad();
};
</script>

<style lang="scss" scoped>
</style>